package com.ruoyi.swla2.service.impl;

import com.ruoyi.swla2.domain.WarnStrategy;
import com.ruoyi.swla2.mapper.WarnStrategyMapper;
import com.ruoyi.swla2.service.IWarnStrategyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 告警策略Service业务层处理
 *
 * @author gdqt
 * @date 2023-06-16
 */
@Service
public class WarnStrategyServiceImpl implements IWarnStrategyService {
    @Autowired
    private WarnStrategyMapper warnStrategyMapper;

    /**
     * 查询告警策略
     *
     * @param ID 告警策略主键
     * @return 告警策略
     */
    @Override
    public WarnStrategy selectWarnStrategyByID(Long ID) {
        return warnStrategyMapper.selectWarnStrategyByID(ID);
    }

    /**
     * 查询告警策略列表
     *
     * @param warnStrategy 告警策略
     * @return 告警策略
     */
    @Override
    public List<WarnStrategy> selectWarnStrategyList(WarnStrategy warnStrategy) {
        return warnStrategyMapper.selectWarnStrategyList(warnStrategy);
    }

    /**
     * 新增告警策略
     *
     * @param warnStrategy 告警策略
     * @return 结果
     */
    @Override
    public int insertWarnStrategy(WarnStrategy warnStrategy) {
        return warnStrategyMapper.insertWarnStrategy(warnStrategy);
    }

    /**
     * 修改告警策略
     *
     * @param warnStrategy 告警策略
     * @return 结果
     */
    @Override
    public int updateWarnStrategy(WarnStrategy warnStrategy) {
        return warnStrategyMapper.updateWarnStrategy(warnStrategy);
    }

    /**
     * 批量删除告警策略
     *
     * @param IDs 需要删除的告警策略主键
     * @return 结果
     */
    @Override
    public int deleteWarnStrategyByIDs(Long[] IDs) {
        return warnStrategyMapper.deleteWarnStrategyByIDs(IDs);
    }

    /**
     * 删除告警策略信息
     *
     * @param ID 告警策略主键
     * @return 结果
     */
    @Override
    public int deleteWarnStrategyByID(Long ID) {
        return warnStrategyMapper.deleteWarnStrategyByID(ID);
    }
}
